package com.helloscala.model

import slick.driver.PostgresDriver
import com.github.tminglei.slickpg._
import org.json4s.native.JsonMethods
import com.github.tototoshi.slick.GenericJodaSupport

/**
 * Created by yangjing on 14-1-15.
 */
trait MyPostgresDriver
  extends PostgresDriver
  with PgArraySupport
  with PgDateSupport
  with PgRangeSupport
  with PgHStoreSupport
  with PgJsonSupport
  with PgSearchSupport
  with PgPostGISSupport {
  /// for json support
  type DOCType = text.Document
  override val jsonMethods = JsonMethods

  ///
  override val Implicit = new ImplicitsPlus {}
  override val simple = new SimpleQLPlus {}

  //////
  trait ImplicitsPlus
    extends Implicits
    with ArrayImplicits
    with DateTimeImplicits
    with RangeImplicits
    with HStoreImplicits
    with JsonImplicits
    with SearchImplicits
    with PostGISImplicits

  trait SimpleQLPlus
    extends SimpleQL
    with ImplicitsPlus
    with SearchAssistants
    with PostGISAssistants

}

object MyPostgresDriver extends MyPostgresDriver

object MyPostgresJodaSupport extends GenericJodaSupport(MyPostgresDriver)